<?php

// 私人定制表单分页列表
// GET self.volist

namespace app\api\resource\self;
use app\api\lib\Page;
use think\facade\Session;

class Volist
{
    // 方法
    public $_method = ['GET'];
    // 前置
    public $_pre    = ['member'];
    // 描述
    public $_description = '私人定制表单分页列表';
    // 参数
    public $_param  = [
        'page' => '请求页',
        'show' => '每页记录数量',
    ];

    public function run(&$request)
    {
        $page    = $request->get('page/d',1);
        $show    = $request->get('show/d',10);

        $member  = Session::get('member');

        $table   = 'self_form';
        $where[] = [ 'mid','=',$member['id'] ];
        $order   = 'status,create_time DESC';
        $pagelist = Page::run($table,$where,$order,$page,$show);

        // p($pagelist);die;

        return [200,$pagelist];
    }
}
